<template>
  <div>
    <van-cell-group title="基础散点图">
      <div id="myChart" ref="myChart" />
    </van-cell-group>
  </div>
</template>

<script>
import * as echarts from 'echarts';
export default {
  data() {
    return {
      chart: null,
      options: {}
    };
  },
  mounted() {
    this.initOptions();
  },
  methods: {
    initOptions() {
      var chartDom = document.getElementById('myChart');
      var myChart = echarts.init(chartDom);
      var option;

      option = {
        xAxis: {},
        yAxis: {},
        series: [
          {
            symbolSize: 20,
            data: [
              [12.5, 6.82],
              [3.03, 4.23],
              [12.2, 7.83],
              [2.02, 4.47],
              [1.05, 3.33],
              [11.0, 8.84],
              [7.08, 5.82],
              [5.02, 5.68]
            ],
            type: 'scatter'
          }
        ]
      };
      option && myChart.setOption(option);
    }
  }
};
</script>

<style scoped>
#myChart {
  width: 100%;
  height: 280px;
}
</style>
